#{extends 'main.html' /}
#{set title:'Tree' /}

#{set 'moreScripts'}
    #{script 'jquery.jstree.js'/}
    <script type="text/javascript">
        $(function(){
            $("#tree").jstree({
                themes : {theme:"apple"},
                json_data: {
                    ajax:{
                        url:"@{Tree.childs}",
                        data:function(node){
                            return {path:node==-1? "/" : node[0].id};
                        }
                    }
                },
                plugins:["themes","json_data"]
            });
        });
    </script>
#{/set}

<div id="tree" >
</div>
